作者:梁梁庆新 | 来源:互联网 | 2023-09-24 19:26
Demos
- https://v2-mst-aptd-at-lcz-sty.vercel.app/ uses the latest branch commit
- https://nrn-v2-mst-aptd-at-lcz-sty-c1.vercel.app/ is the production environment for Customer 1
- https://nrn-v2-mst-aptd-at-lcz-sty-c1-preview.vercel.app/ is the preview/staging environment for Customer 1 (with Preview mode enabled)
- https://nrn-v2-mst-aptd-at-lcz-sty-c2.vercel.app/ is the production environment for Customer 2
- https://nrn-v2-mst-aptd-at-lcz-sty-c2-preview.vercel.app/ is the preview/staging environment for Customer 2 (with Preview mode enabled)
Status
This PR/branch is stable and has been added as the new official/default NRN preset.
Notes
This PR is not meant to be merged, but to provide a diff against the base branch (which is a preset using GraphCMS)
Objectives
The goal is to replace GraphQL API by Airtable API, for several reasons:
- Showcase how to consume a REST-ish API
- Easier to setup than GraphCMS
- Airtable provides a free plan, and has much higher limitations than GraphCMS for its free plan
- Requested https://github.com/UnlyEd/next-right-now/issues/16
- Make this the new default preset (simpler, cheaper)
Base preset: v2-mst-aptd-gcms-lcz-sty
New preset name: v2-mst-aptd-at-lcz-sty
Roadmap
- ✅ Setup AT base and tables
- ✅ Fetch data from AT API
- ✅ Update TS data types (minor differences between GraphCMS schema and Airtable schema)
- ✅ Consolidate all AT API calls into one (AT uses a REST API, which forces us to send 3 requests to fetch all the data we need)
- ✅ Sanitise AT records
- ✅ Handle content i18n (for each field, select the value for the most preferred locale if set, otherwise fallback to secondary locale)
- ✅ Completely remove GraphQL/GraphCMS/Apollo related code (useless with this preset, should lower the bundle size quite a bit)
- ✅ Update UIs to use data from Airtable
- ✅ Optimise requests to Airtable API (use local cache, like https://github.com/alexreardon/memoize-one#readme)
- WIP PR at https://github.com/UnlyEd/next-right-now/pull/92
- Open issue at https://github.com/vercel/next.js/discussions/13765
- ✅ Display images from Airtable (
component)
- Handle image optimisations (?)
- ✅ Integrate Stacker as an admin backend (deal in progress) and configure it so that visitors can use it to update the data and see live changes
该提问来源于开源项目:UnlyEd/next-right-now
[GitHub Actions]
Deployment FAILED
Commit 5f8b8f798a833a2e72218e2339ac2ccdb46b20a3 failed to deploy to (click to see logs)